package cloud.demo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hxg
 * @version 1.0
 * @date 2022/1/11 13:24
 */
@RestController
//动态刷新
@RefreshScope
public class configController {
    @Value("${config.info}")
    public String configInfo;

    @Value("${server.port}")
    public String serverPort;

    @GetMapping("/nacos/config/info")
    public String getConfigInfo(){
        return serverPort+"====="+configInfo;
    }
}
